﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="category.ascx.cs" Inherits="TimKen.Web.UserControls.category" %>
<div class="title">
    <span class="search">
        <%=GetLangString("NewSearch")%></span>
</div>
<div class="boxcontent">
    <%--  <!--类别循环-->
    <%foreach (System.Data.DataRow dr in drcPCategory)
      { %>
    <div class="type">
        <a href='/Product/ChildCategory.aspx?cid=<%=dr["CategoryID"].ToString()%>'>
            <%=dr["CategoryName"]%></a>
    </div>
    <div class="subtype">
        <%System.Data.DataSet ds = pcm.GetChild(int.Parse(dr["CategoryID"].ToString()), LanguageID, 0);
          System.Data.DataRowCollection drc = ds.Tables[0].Rows;
        %>
        <% if (LanguageID == 1)
           {//中文%>
        <%
            int i = 0;
            int strLengthRow = 12;//行最大字符数
            while (i < drc.Count)
            {
                if (i + 1 < drc.Count)
                {
                    //打印两个
                    if (drc[i]["CategoryName"].ToString().Length + drc[i + 1]["CategoryName"].ToString().Length < strLengthRow)
                    {
                        //两条 +2
        %>
        <a href='/Product/ChildCategory.aspx?cid=<%=drc[i]["CategoryID"].ToString()%>'>
            <%=drc[i]["CategoryName"].ToString()%></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href='/Product/ChildCategory.aspx?cid=<%=drc[i+1]["CategoryID"].ToString()%>'>
                <%=drc[i + 1]["CategoryName"].ToString()%></a><br />
        <%
            i = i + 2;
                    }
                    else
                    {
                        //一条 +1
        %>
        <a href='/Product/ChildCategory.aspx?cid=<%=drc[i]["CategoryID"].ToString()%>'>
            <%=drc[i]["CategoryName"].ToString()%></a><br />
        <%
            i = i + 1;
                    }
                }
                else
                {
                    //打印一条 +1
        %>
        <a href='/Product/ChildCategory.aspx?cid=<%=drc[i]["CategoryID"].ToString()%>'>
            <%=drc[i]["CategoryName"].ToString()%></a>
        <%
            i = i + 1;
                }
            }
        %>
        <%}else{ //英文%>
            <%
            int i = 0;
            int strLengthRow = 27;//行最大字符数
            while (i < drc.Count)
            {
                if (i + 1 < drc.Count)
                {
                    //打印两个
                    if (drc[i]["CategoryName"].ToString().Length + drc[i + 1]["CategoryName"].ToString().Length < strLengthRow)
                    {
                        //两条 +2
        %>
        <a href='/Product/ChildCategory.aspx?cid=<%=drc[i]["CategoryID"].ToString()%>'>
            <%=drc[i]["CategoryName"].ToString()%></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href='/Product/ChildCategory.aspx?cid=<%=drc[i+1]["CategoryID"].ToString()%>'>
                <%=drc[i + 1]["CategoryName"].ToString()%></a><br />
        <%
            i = i + 2;
                    }
                    else
                    {
                        //一条 +1
        %>
        <a href='/Product/ChildCategory.aspx?cid=<%=drc[i]["CategoryID"].ToString()%>'>
            <%=drc[i]["CategoryName"].ToString()%></a><br />
        <%
            i = i + 1;
                    }
                }
                else
                {
                    //打印一条 +1
        %>
        <a href='/Product/ChildCategory.aspx?cid=<%=drc[i]["CategoryID"].ToString()%>'>
            <%=drc[i]["CategoryName"].ToString()%></a>
        <%
            i = i + 1;
                }
            }
        %>
        <% }%>
    </div>
    <%} %>--%>
    <NineRays:FlyTreeView ID="FlyTreeView1" runat="server" DisplayBar="false" Width="100%"
        FadeEffect="false" BorderColor="Silver" BorderWidth="0px" Height="100%" PostBackOnSelect="true"
        Padding="2px" EnableViewState="true" OnPopulateNodes="FlyTreeView1_PopulateNodes"
        OnSelectedNodeChanged="FlyTreeView1_SelectedNodeChanged" ImageSet="WinXP">
        <DefaultStyle Font-Names="Verdana" Font-Size="11px" ForeColor="Black" Padding="2px;4px;4px;2px"
            Wrap="true" RowHeight="18px" />
        <SelectedStyle BackColor="68, 123, 205" BorderColor="150, 150, 150" BorderWidth="1px"
            Padding="1px;3px;3px;1px" BorderStyle="Solid" ForeColor="White" />
        <HoverStyle Font-Underline="True" />
    </NineRays:FlyTreeView>
    <script type="text/javascript">
        var getTreeContain = document.getElementById("<%=FlyTreeView1.ClientID %>");
        getTreeContain.style.overflow = "";   
    </script>
</div>
